#ifndef CEDIT_H
#define CEDIT_H

#include "cControl.h"

enum EDIT_EVENTS {EDIT_CHANGE};

class cEdit : public cControl
{
    public:

        functionEvenement   OnChange;
        functionEvenement   OnGetFocus;
        functionEvenement   OnKillFocus;
        functionEvenement   OnValidate;

        bool             TraitementEvent(HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam,LRESULT & resultat);

        cEdit           (cHwnd* parent,int x,int y,int width,int height=20,cHwnd * HWNDParent=NULL);
        //void            AddEventHandler(EDIT_EVENTS event,ptHandleFunction Fonction);
        string          getText();
        bool            getEnabled();

        void            setEnabled(bool enable);
        void            setPasswordChar(char caractere=0);
        void            setText(string nouveauTexte);
        void            SetBackgroundColor(int r,int v, int b);
        void            SetFontColor(int r,int v, int b);
        void            SetFocus();

        ~cEdit          ();

    protected:

    private:
        HBRUSH          backgroundColor;
        COLORREF        foregroundColor;
        bool            _enable;
        //LRESULT         Redessine(event_struct event);
};

#endif // CEDIT_H
